package com.openscorer;

import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

public class RangeMapTest extends TestCase {
	private RangeMap map_;
	
	protected void setUp() {
		map_ = new RangeMap("0/1:2,2/3:5,5/100:6");
	}
	protected void testBasicFunctionality() {
		assertEquals(2, map_.map(0));
		assertEquals(2, map_.map(1));
		assertEquals(5, map_.map(2));
		assertEquals(5, map_.map(3));
		assertEquals(6, map_.map(5));
		assertEquals(6, map_.map(99));
	}
	protected void testGap(){
		assertEquals(0, map_.map(4));
	}
	public static Test suite() {
		TestSuite suite = new TestSuite("Test for com.openscorer");
		suite.addTestSuite(RangeMapTest.class);
		return suite;
	}  
}
